//
//  WebPath.m
//  WRY
//
//  Created by Yang on 8/20/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "WebPath.h"


@implementation WebPath
+(NSString *)filePath:(NSString *)fileName
{
	NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
	NSString *path = [documentsDirectory stringByAppendingPathComponent:fileName];
	return path;
}
+(NSString *)loginPath {
	
    NSString *defaultPath=@"http://218.94.78.64:8090/MobileWebService/SystemManage/WebService__SystemManage__Json.ashx";
    NSUserDefaults *dataDefault=[NSUserDefaults standardUserDefaults];
    NSString *loginPath=[NSString stringWithFormat:@"%@",[dataDefault objectForKey:@"WebService__SystemManage__Json"]];
    if (![loginPath isKindOfClass:[NSNull class]]) {
        if ([loginPath isEqualToString:@"(null)"] || [loginPath isEqualToString:@""]) {
            return defaultPath;
        }
        else {
             return loginPath;
        }
    }
    else {
        return defaultPath;
    }
	
}
+(NSString *)enterprisePath {
	 
    NSString *defaultPath=@"http://218.94.78.64:8090/MobileWebService/Enterprise/WebService__Enterprise__Json.ashx";
    NSUserDefaults *dataDefault=[NSUserDefaults standardUserDefaults];
    NSString *wryPath=[NSString stringWithFormat:@"%@",[dataDefault objectForKey:@"WebService__Enterprise__Json"]];
    if (![wryPath isKindOfClass:[NSNull class]]) {
        if ([wryPath isEqualToString:@"(null)"] || [wryPath isEqualToString:@""]) {
            return defaultPath;
        }
        else {
            return  wryPath;
        }

    }
    else {
        return defaultPath;
    }
}

@end
